   1 .MICROTREK
  20 :return 
  30 clear ;NT=0
  40 D=rnd (40);if D<30goto 40
  50 W=rnd (35);if W<10goto 50
  60 D=(Dmul W)div 20;L=10000
  70 print "  *MICRO TREK*"
 100 A=0;K=0;S=10;T=10
 110 for I=1to 64;@(I)=0
 120 X=rnd (12);if X>2@(I)=1
 130 if X=3if K<W@(I)=2;K=K+1
 140 next I
 150 X=rnd (64);if @(X)>1goto 150
 160 @(X)=3;gosub 850;B=rnd (17);if B>5goto 200
 170 X=rnd (64);if @(X)>1goto 170
 180 @(X)=4;S=(X-1)div 8;T=X-Smul 8
 200 clear ;C=E-S;if C<0C=-C
 210 G=F-T;if G<0G=-G
 220 Q=0;if C<2if G<2Q=1
 230 D=D-1;if D=0goto 970
 240 if (K=0)+(Q=1)goto 270
 250 gosub 860;print #4,H,"UNIT HIT FROM"
 260 print "KLINGONS!!"
 270 if Q=1L=10000
 280 input "COMMAND: "A
 290 if A=1goto 350
 300 if A=2goto 400
 310 if A=3goto 450
 320 if A=4goto 550
 330 if A=5goto 650
 340 goto 280
 350 gosub 920;X=(Y-1)mul 8+Z;if @(X)#1print "SECTOR OCCUPIED";goto 350
 360 U=1;gosub 870;@(X)=3;@(Emul 8+F)=1;gosub 850;goto 200
 400 G=rnd (250)+300;U=1;gosub 900;goto 100
 450 gosub 920;U=2;gosub 870;X=(Y-1)mul 8+Z;U=@(X);if U<2goto 230
 460 if U=3print "YOU DESTROYED YOURSELF!!";goto 990
 470 if U=4print "STARBASE DESTROYED!!";S=10;T=10;goto 200
 480 if R>500if (rnd (Rdiv 500)+6)>10print "YOU MISSED!!";goto 230
 490 @(X)=1;K=K-1;W=W-1;if W>0goto 230
 500 print "MISSION ACCOMPLISHED!!";goto 990
 550 clear ;gosub 630
 560 for I=1to 8;print #1,I,;for J=1to 8
 570 X=@((I-1)mul 8+J);if X=0print " * ",
 580 if X=1print " . ",
 590 if X=2print " K ",
 600 if X=3print " E ",
 610 if X=4print " B ",
 620 next J;print #1,I;next I;gosub 630;goto 280
 630 print "  1  2  3  4  5  6  7  8";return 
 650 clear ;print "     STATUS REPORT"
 660 print "SECTOR:",#17,E+1,",",#1,F
 670 print "STARDATE:",#17,D
 680 print "ENERGY:",#19,L;print "KLINGONS:",#17,W
 690 print "CONDITION:         ",;gosub 700;goto 280
 700 if Q=1print "DOCKED";return 
 710 if K>0print "   RED";return 
 720 if L>2000print " GREEN";return 
 730 print "YELLOW";return 
 850 E=(X-1)div 8;F=X-Emul 8;return 
 860 H=(rnd (50)+200)mul K;G=H;U=1;goto 900
 870 R=(((Y-E)mul (Y-E))+((Z-F)mul (Z-F)))mul 100
 880 G=Rdiv 10;if G=0return 
 890 J=G;G=(Rdiv G+G)div 2;if G<Jgoto 890
 900 L=L-Umul G;if L>0return 
 910 print "OUT OF ENERGY!!";goto 990
 920 input "SECTOR ROW: "Y;if Y=0goto 280
 930 if (Y<1)+(Y>8)goto 920
 940 input "SECTOR COLUMN: "Z;if Z=0goto 280
 950 if (Z<1)+(Z>8)goto 940
 960 return 
 970 print "OUT OF TIME!!";goto 990
 990 print "GAME OVER."
>run 